1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module sourceview.GutterRendererPixbuf; 26 27 private import gdk.PaintableIF; 28 private import gdkpixbuf.Pixbuf; 29 private import gio.IconIF; 30 private import glib.ConstructionException; 31 private import glib.Str; 32 private import glib.c.functions; 33 private import gobject.ObjectG; 34 private import sourceview.GutterRenderer; 35 private import sourceview.c.functions; 36 public import sourceview.c.types; 37 38 39 /** 40 * Renders a pixbuf in the gutter. 41 * 42 * A `GtkSourceGutterRendererPixbuf` can be used to render an image in a cell of 43 * [class@Gutter]. 44 */ 45 public class GutterRendererPixbuf : GutterRenderer 46 { 47 /** the main Gtk struct */ 48 protected GtkSourceGutterRendererPixbuf* gtkSourceGutterRendererPixbuf; 49 50 /** Get the main Gtk struct */ 51 public GtkSourceGutterRendererPixbuf* getGutterRendererPixbufStruct(bool transferOwnership = false) 52 { 53 if (transferOwnership) 54 ownedRef = false; 55 return gtkSourceGutterRendererPixbuf; 56 } 57 58 /** the main Gtk struct as a void* */ 59 protected override void* getStruct() 60 { 61 return cast(void*)gtkSourceGutterRendererPixbuf; 62 } 63 64 /** 65 * Sets our main struct and passes it to the parent class. 66 */ 67 public this (GtkSourceGutterRendererPixbuf* gtkSourceGutterRendererPixbuf, bool ownedRef = false) 68 { 69 this.gtkSourceGutterRendererPixbuf = gtkSourceGutterRendererPixbuf; 70 super(cast(GtkSourceGutterRenderer*)gtkSourceGutterRendererPixbuf, ownedRef); 71 } 72 73 74 /** */ 75 public static GType getType() 76 { 77 return gtk_source_gutter_renderer_pixbuf_get_type(); 78 } 79 80 /** 81 * Create a new #GtkSourceGutterRendererPixbuf. 82 * 83 * Returns: A #GtkSourceGutterRenderer 84 * 85 * Throws: ConstructionException GTK+ fails to create the object. 86 */ 87 public this() 88 { 89 auto __p = gtk_source_gutter_renderer_pixbuf_new(); 90 91 if(__p is null) 92 { 93 throw new ConstructionException("null returned by new"); 94 } 95 96 this(cast(GtkSourceGutterRendererPixbuf*) __p, true); 97 } 98 99 /** 100 * Get the gicon of the renderer 101 * 102 * Returns: a #GIcon 103 */ 104 public IconIF getGicon() 105 { 106 auto __p = gtk_source_gutter_renderer_pixbuf_get_gicon(gtkSourceGutterRendererPixbuf); 107 108 if(__p is null) 109 { 110 return null; 111 } 112 113 return ObjectG.getDObject!(IconIF)(cast(GIcon*) __p); 114 } 115 116 /** */ 117 public string getIconName() 118 { 119 return Str.toString(gtk_source_gutter_renderer_pixbuf_get_icon_name(gtkSourceGutterRendererPixbuf)); 120 } 121 122 /** 123 * Gets a [iface@Gdk.Paintable] that was set with 124 * [method@GutterRendererPixbuf.set_paintable] 125 * 126 * Returns: a #GdkPaintable or %NULL 127 */ 128 public PaintableIF getPaintable() 129 { 130 auto __p = gtk_source_gutter_renderer_pixbuf_get_paintable(gtkSourceGutterRendererPixbuf); 131 132 if(__p is null) 133 { 134 return null; 135 } 136 137 return ObjectG.getDObject!(PaintableIF)(cast(GdkPaintable*) __p); 138 } 139 140 /** 141 * Get the pixbuf of the renderer. 142 * 143 * Returns: a #GdkPixbuf 144 */ 145 public Pixbuf getPixbuf() 146 { 147 auto __p = gtk_source_gutter_renderer_pixbuf_get_pixbuf(gtkSourceGutterRendererPixbuf); 148 149 if(__p is null) 150 { 151 return null; 152 } 153 154 return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) __p); 155 } 156 157 /** 158 * Allows overlaying a paintable on top of any other image that 159 * has been set for the pixbuf. This will be applied when the 160 * widget is next snapshot. 161 * 162 * Params: 163 * paintable = a #GdkPaintable 164 */ 165 public void overlayPaintable(PaintableIF paintable) 166 { 167 gtk_source_gutter_renderer_pixbuf_overlay_paintable(gtkSourceGutterRendererPixbuf, (paintable is null) ? null : paintable.getPaintableStruct()); 168 } 169 170 /** */ 171 public void setGicon(IconIF icon) 172 { 173 gtk_source_gutter_renderer_pixbuf_set_gicon(gtkSourceGutterRendererPixbuf, (icon is null) ? null : icon.getIconStruct()); 174 } 175 176 /** */ 177 public void setIconName(string iconName) 178 { 179 gtk_source_gutter_renderer_pixbuf_set_icon_name(gtkSourceGutterRendererPixbuf, Str.toStringz(iconName)); 180 } 181 182 /** */ 183 public void setPaintable(PaintableIF paintable) 184 { 185 gtk_source_gutter_renderer_pixbuf_set_paintable(gtkSourceGutterRendererPixbuf, (paintable is null) ? null : paintable.getPaintableStruct()); 186 } 187 188 /** */ 189 public void setPixbuf(Pixbuf pixbuf) 190 { 191 gtk_source_gutter_renderer_pixbuf_set_pixbuf(gtkSourceGutterRendererPixbuf, (pixbuf is null) ? null : pixbuf.getPixbufStruct()); 192 } 193 }